﻿using System;
using KillBill.Business.Entities;
using KillBill.Presentation.Common;
using KillBill.Presentation.Modules.Administration.AdministrationServiceReference;
using KillBill.Presentation.Modules.Administration.IView;

namespace KillBill.Presentation.Modules.Administration.Presenter
{
    public class CustomerFindPresenter
    {
        private readonly AdministrationServiceClient _service = new AdministrationServiceClient();

        private ICustomerFind View{ get; set;}
        private Customer _customer = new Customer();

        public CustomerFindPresenter(ICustomerFind view)
        {
            View = view;
        }

        public void SearchCustomer()
        {
            try
            {
                //var customerList = _service.FindCustomerByLastName(View.CustomerID, Context.SessionID);
                //if(!customerList.Success)
                //    {
                //    if (customerList.Messages.Count > 0)
                    
                //        View.ShowMessage(customerList.Messages[0]);
                //    }
                //    else
                //    View.Customers = customerList.Customers;
            }
            catch (Exception)
            {
                View.ShowConnectionErrorMessage("Clientes");
            }
        }
    }
}
